package com.isoft.demo01.dao;


import com.isoft.demo01.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao {
    @Insert("insert into tb_user(username,password) values(#{username},#{pwd})")
    public int add(@Param("username") String username, @Param("pwd") String password);

    @Select("select * from tb_user where username=#{username}")
    public User chackName(@Param("username") String username);

    @Select("select * from tb_user where username=#{username} and password=#{pwd}")
    public User getByAccount(@Param("username") String username, @Param("pwd") String password);
    @Insert("insert into tb_user(username,password,email,phone) values(#{username},#{pwd},#{email},#{phone})")
    public int adduser(@Param("username")String username,@Param("pwd")String password,@Param("email")String email,@Param("phone")String phone);
}
